
<template>
    <div>
        <!-- 这是home -->
        <NuxtPage />
        {{data.data}}
        {{conuter.password}}
        <input type="text" />
        <!-- <client-only > 
            
        </client-only> -->
        <el-button type="primary" v-if="data.isOrNot">Primary</el-button>
        <button @click="switchMe()">切换e</button>
        <button @click="clickMe()">clickMe</button>
    </div>
</template>

<script setup>
import http from "../http/index";
const conuter = useCounter()
const data =  reactive({
    data:"这是数据",
    isOrNot:true
})
const clickMe = () =>{
    conuter._object.$scounter.password++
    navigateTo('/')
}
const switchMe =()=>{
    data.isOrNot=!data.isOrNot
    console.log(data.isOrNot)
}
http.get('').then((res)=>{
    console.log("请求数据",res)
    // localStorage.setItem("ssr",(JSON.stringify(res)))

})

// const { res, error } = await useAsyncData('count', () => {
//     return $fetch('http://localhost:9999') // 请求地址
// })

// console.log(conuter)
</script>

<style lang="scss" scoped>

</style>